﻿#ifndef THREADTASKMANAGER_H
#define THREADTASKMANAGER_H

#include <QObject>
#include <QList>
#include <QMap>
#include "API_BaseWidget.h"

namespace BaseWidget
{
    class ThreadTask;
    class ThreadControl;

    class API_BASEWIDGET ThreadTaskManager : public QObject
    {
        Q_OBJECT

    public:
        static ThreadTaskManager* getInstance();

        void clearThreadList();

    public slots:
        void slot_appendThread(ThreadControl* thread);
        void slot_removeThread(QString uuid);
        void slot_appendThreadTask(ThreadTask* threadTask);

    private:
        ThreadTaskManager();
        ~ThreadTaskManager() = default;

    private:
        static ThreadTaskManager* m_instance;
        QMap<QString, ThreadControl*> m_threadContolList;
    };
}
#endif // THREADTASKMANAGER_H
